package com.thethinkfactory.whosappfor.model.db;

import android.database.sqlite.SQLiteDatabase;

public class TableEvent {

	public static final String TABLE_NAME = "event";
	public static final String COLUMN_ID = "_id";
	public static final String COLUMN_TITLE = "title";
	public static final String COLUMN_DESC = "description";

	public static final String[] ALL_COLUMNS = { COLUMN_ID, COLUMN_TITLE,
			COLUMN_DESC };

	private static final String TABLE_CREATE = "create table " + TABLE_NAME
			+ " (" + COLUMN_ID + " integer primary key autoincrement, "
			+ COLUMN_TITLE + " text not null, " + COLUMN_DESC
			+ " text not null);";

	public static void onCreate(SQLiteDatabase database) {
		database.execSQL(TABLE_CREATE);
	}

	public static void onUpgrade(SQLiteDatabase database, int oldVersion,
			int newVersion) {
		database.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
		onCreate(database);
	}
}
